g_list_free_full (detected_networks, g_object_unref);
}
- /* avoid to update widgets if the operation was cancelled in finalize */
- if (priv->listbox != NULL)
+ g_object_unref (view);
+
+ /* avoid to update widgets if we are already destroyed
+ (and got cancelled s a result of that) */
+ if (!priv->destroyed)
{
update_network_state (view);
update_loading (view);
g_warning ("Failed to fetch network locations: %s", error->message);
g_clear_error (&error);
+ g_object_unref (GTK_PLACES_VIEW (user_data));
}
else
{
gtk_places_view_set_fetching_networks (view, TRUE);
update_network_state (view);
+ g_object_ref (view);
g_file_enumerate_children_async (network_file,
"standard::type,standard::target-uri,standard::name,standard::display-name,standard::icon",
G_FILE_QUERY_INFO_NONE,